package service

import (
	"context"
	"monoblog/common"
	"monoblog/common/register"
	"monoblog/domain/dto"
	"monoblog/domain/model"
)

func GetUserService() UserService {
	return register.GetInstance[UserService]("UserService")
}

type UserService interface {
	// AddUser 添加
	AddUser(ctx context.Context, form dto.UserRegisterReqForm) error

	// ExistsByUserId 查询是否存在
	ExistsByUserId(ctx context.Context, userId string) (bool, error)

	// ExistsByPhoneOrEmail 查询是否存在
	ExistsByPhoneOrEmail(ctx context.Context, phoneOrEmail string) (bool, error)

	FindByUserId(ctx context.Context, userId string) (*model.WebUser, error)

	FindInUserIds(ctx context.Context, userIds []string) ([]*model.WebUser, error)

	FindFullByUserId(ctx context.Context, userId string) (*model.WebUser, error)

	FindPage(ctx context.Context, query dto.UserQuery) (*common.PageData[*model.WebUser], error)
}
